package com.zhanghu.backendZray.utils.saleOrder;

import com.zhanghu.backendZray.constants.CommonConstant;

import java.time.LocalDateTime;
import java.util.concurrent.ThreadLocalRandom;

/**
 * @author ZhangDong
 * @date 2024/8/9 16:33
 */
public class SaleOrderUtil {

    /**
     * 获取销售单号
     * @return
     */
    public static String generateOrderNo() {
        int random = ThreadLocalRandom.current().nextInt(10000, 99999);
        return CommonConstant.ORDER_NO_PREFIX + LocalDateTime.now()
                .format(CommonConstant.NO_SPLITE_DATE_TIME_FORMATTER) + random;
    }
}
